//
// Created by 21126 on 2023/5/30.
//
#include <vector>
#include <opencv2/opencv.hpp>
#include <opencv2/face.hpp>

int main()
{
    std::vector<cv::Mat> images;
    std::vector<int> labels;

    cv::Mat person1_img1 = cv::imread("filepath", cv::IMREAD_GRAYSCALE);
    images.push_back(person1_img1);
    labels.push_back(0);

    cv::Ptr<cv::face::LBPHFaceRecognizer> recognizer = cv::face::LBPHFaceRecognizer::create();

    recognizer->train(images, labels);

    recognizer->save("model_path");

    return 0;
}